<?php
class Zend_View_Helper_ShowTagIndex{
    public function showTagIndex($view) {

    	$tags = $view->tags;
    	$str='';
        $str .= '<table width="960">';
	$str .= '<tr>';
 
        $str .= '<table id="product-table" border="0" cellpadding="0" cellspacing="0" width="100%">';
        $str .= '<tr>';
        $str .= '<th class="table-header-repeat line-left minwidth-1"><a href="">Tag</a></th>';
        $str .= '<th class="table-header-options line-left minwidth-2"><a href="">Thao tác</a></th>';
        $str .= '</tr>';

        $i=0;
        foreach ($tags as $tags) {
            if($i>=1)
                $i=0;
            else
                $i++;
            
            if($i==1)
                $str .= '<tr>';
            else 
                $str .= '<tr class="alternate-row">';
                
            $str .='<td>'.$tags->tag_text.'</td>';
            $str .= '<td class="options-width">';
            $str .= '<a title="Sửa" class="icon-1 info-tooltip" href="'.$view->url(array('controller'=>'tag', 'action'=>'edit', 'tag_id'=>$tags->tag_id)).'"></a> ';
            $str .= '<a title="Thêm" class="icon-3 info-tooltip" href="'.$view->url(array('controller'=>'tag', 'action'=>'add')).'"></a>';
            $str .= '<a title="Xóa" onclick="return confirm(\'Are you sure you want to delete?\')" class="icon-2 info-tooltip" href="'.$view->url(array('controller'=>'tag', 'action'=>'delete','tag_id'=>$tags->tag_id)).'"></a></td>';
            $str .='</tr>';
        }
        $str .= '</table>';
        
        return $str; 

    }
}